#ifndef SAMPLE_LIGHT_H
#define SAMPLE_LIGHT_H
#include "SampleBase.h"
#include "Types.h"
#include "Sphere.h"
#include "HitableList.h"
#include "ImageParam.h"
#include "Camera.h"
#include "Lambertian.h"
#include "Box.h"
#include "Rectangle.h"
#include "Disk.h"
#include "DiffuseLight.h"
namespace RayTracer
{
	class LightSample : public SampleBase
	{
	public:
		LightSample() = default;
		~LightSample() = default;

		void Init();
		void Render();
		void ImGui();
		void ShutDown();
	private:
		vec3 RayColor(const Ray& r, const vec3& background, const Hitable& world, int depth);
	private:
		int curIndex;
		bool isGenerate;
		ImageParam mImageParam; // output image
		int samples_per_pixel = 10;
		int maxDepth = 10;
		bool isNormal = false;
		// scene
		HitableList world;
		std::shared_ptr<XZ_Rect> floor;
		std::shared_ptr<XY_Rect> leftLight;
		std::shared_ptr<XY_Rect> rightLight;
		std::shared_ptr<XZ_Rect> upLight;

		std::shared_ptr<Lambertian> floorMat;
		std::shared_ptr<DiffuseLight> leftLightMat;
		std::shared_ptr<DiffuseLight> rightLightMat;
		std::shared_ptr<DiffuseLight> upLightMat;

		// camera
		Camera camera;
		vec3 lookfrom;
		vec3 lookat;
		float fov;

		// sky color
		vec3 upColor;
		vec3 downColor;
		vec3 bgColor;
		vec3 groundColor;
		vec3 leftColor;
		vec3 rightColor;
		vec3 upLightColor;

		float leftLightScale,rightLightScale,upLightScale;
	};
}
#endif // !SAMPLE_LIGHT_H
